using Volo.Abp.Authorization.Permissions;

namespace UserManagementService.Permissions;

public static class UserManagementPermissions
{
    public const string GroupName = "UserManagement";

    internal static class Users
    {
        public const string Default = GroupName + ".Users";
        public const string Create = Default + ".Create";
        public const string Edit = Default + ".Edit";
        public const string Delete = Default + ".Delete";
        public const string Manage = Default + ".Manage";
        public const string Impersonate = Default + ".Impersonate";
        public const string Unlock = Default + ".Unlock";
        public const string ChangePermissions = Default + ".ChangePermissions";
        public const string ViewPermissions = Default + ".ViewPermissions";
        public const string ManageRoles = Default + ".ManageRoles";
        public const string ViewRoles = Default + ".ViewRoles";
        public const string ManageOrganizations = Default + ".ManageOrganizations";
        public const string ViewOrganizations = Default + ".ViewOrganizations";
        public const string Export = Default + ".Export";
        public const string Import = Default + ".Import";
    }

    internal static class Organizations
    {
        public const string Default = GroupName + ".Organizations";
        public const string Create = Default + ".Create";
        public const string Edit = Default + ".Edit";
        public const string Delete = Default + ".Delete";
        public const string Manage = Default + ".Manage";
        public const string ViewMembers = Default + ".ViewMembers";
        public const string ManageMembers = Default + ".ManageMembers";
        public const string Export = Default + ".Export";
        public const string Import = Default + ".Import";
    }

    internal static class Roles
    {
        public const string Default = GroupName + ".Roles";
        public const string Create = Default + ".Create";
        public const string Edit = Default + ".Edit";
        public const string Delete = Default + ".Delete";
        public const string Manage = Default + ".Manage";
        public const string ViewPermissions = Default + ".ViewPermissions";
        public const string ManagePermissions = Default + ".ManagePermissions";
        public const string Export = Default + ".Export";
        public const string Import = Default + ".Import";
    }

    internal static class PermissionManagement
    {
        public const string Default = GroupName + ".Permissions";
        public const string Manage = Default + ".Manage";
        public const string View = Default + ".View";
        public const string Grant = Default + ".Grant";
        public const string Revoke = Default + ".Revoke";
        public const string Export = Default + ".Export";
    }

    // 公开的常量属性，提供对外访问
    public static class UserPermissions
    {
        public const string Default = Users.Default;
        public const string Create = Users.Create;
        public const string Edit = Users.Edit;
        public const string Delete = Users.Delete;
        public const string Manage = Users.Manage;
        public const string Impersonate = Users.Impersonate;
        public const string Unlock = Users.Unlock;
        public const string ChangePermissions = Users.ChangePermissions;
        public const string ViewPermissions = Users.ViewPermissions;
        public const string ManageRoles = Users.ManageRoles;
        public const string ViewRoles = Users.ViewRoles;
        public const string ManageOrganizations = Users.ManageOrganizations;
        public const string ViewOrganizations = Users.ViewOrganizations;
        public const string Export = Users.Export;
        public const string Import = Users.Import;
    }

    public static class OrganizationPermissions
    {
        public const string Default = Organizations.Default;
        public const string Create = Organizations.Create;
        public const string Edit = Organizations.Edit;
        public const string Delete = Organizations.Delete;
        public const string Manage = Organizations.Manage;
        public const string ViewMembers = Organizations.ViewMembers;
        public const string ManageMembers = Organizations.ManageMembers;
        public const string Export = Organizations.Export;
        public const string Import = Organizations.Import;
    }

    public static class RolePermissions
    {
        public const string Default = Roles.Default;
        public const string Create = Roles.Create;
        public const string Edit = Roles.Edit;
        public const string Delete = Roles.Delete;
        public const string Manage = Roles.Manage;
        public const string ViewPermissions = Roles.ViewPermissions;
        public const string ManagePermissions = Roles.ManagePermissions;
        public const string Export = Roles.Export;
        public const string Import = Roles.Import;
    }
}

// 权限定义类（非嵌套，避免CA1034警告）
internal static class UserManagementPermissionConstants
{
    public const string UserPermissionName = "UserPermissions";
    public const string OrganizationPermissionName = "OrganizationPermissions";
    public const string RolePermissionName = "RolePermissions";
    public const string PermissionManagementName = "PermissionManagement";
}